function sentHttpRequestToServer(url, data, method, successCallback, failCallback, completeCallback) {
  wx.request({
    url: url,
    data: data,
    method: method,
    header: {
      'Content-Type': 'application/json; charset=utf-8'
    },
    success: function (res) {
      //--init data        
      var status = res.data.result;
      if (status != 0) {
        try {
          if (!failCallback(res)) {
            wx.showToast({
              title: res.data.message,
              duration: 3000
            });
          }
        } catch (e) {
          wx.showToast({
            title: res.data.message,
            duration: 3000
          });
        }
        return false;
      }
      successCallback(res.data.resultData,res.data);
    },
    // success: successCallback,
    fail: failCallback,
    complete: completeCallback
  })
}

module.exports= {
  sentHttpRequestToServer: sentHttpRequestToServer
}